﻿//创建时间: 2011-11-27
//创建作者: 李 城
//功能说明: 标签所用到的模型         
//最后修改: 2011-11-27
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data;

namespace TRPOP.CMS.Plugin
{

    /// <summary>
    /// 页面基本信息 模型 带 inner 后缀的表示无须初始化 outer 则表示需要初始化，否则可能会出现异常
    /// </summary>
    [Serializable]
    public class PageInfo
    {
        #region 私有变量
        /// <summary>
        /// 模板类型
        /// </summary>
        private EnumList.TemplateType m_objTemplateType = EnumList.TemplateType.ContentPage;
        /// <summary>
        /// 节点id
        /// </summary>
        private int m_intNodeId = 0;
        /// <summary>
        /// 父节点id
        /// </summary>
        private int m_intParentNodeId = 0;
        /// <summary>
        ///  详细信息id
        /// </summary>
        private int m_intContentId = 0;
        /// <summary>
        /// 末班所在的文件夹位置，默认"/template"
        /// </summary>
        private string m_strCurrentFolder = "/template";
        /// <summary>
        /// 主内容字段
        /// </summary>
        private string m_ContentTableIndexFiled = "content";
        /// <summary>
        /// 内容页是否分页
        /// </summary>
        private bool m_ContentCutFlag = false;
        /// <summary>
        /// 内容分页 最大长度
        /// </summary>
        private int m_ContentPageLength = int.MaxValue;
        /// <summary>
        /// 内容分页类型
        /// </summary>
        private string m_ContentPagingType = "default";
        /// <summary>
        /// 生成的页面的文件名，请去掉.html
        /// </summary>
        private string m_PageName = "";
        /// <summary>
        /// 生成的页面的后缀名
        /// </summary>
        private string m_PageExtName = ".html";
        /// <summary>
        /// 如果为内容页，此信息需要赋值，保存内容的DataTable
        /// </summary>
        private DataTable m_dtContentTable = new DataTable();
        /// <summary>
        ///  是否找到了分页标签
        /// </summary>
        private bool m_FindPageListTag = false;
        /// <summary>
        /// 解析的过程中遇到了分页标签并将其标记记录到此,内部使用
        /// </summary>
        private string m_PageListTag = "";
        /// <summary>
        /// 解析的过程中遇到了分页标签并将其分页Num记录到此,内部使用 
        /// </summary>
        private int m_PageListSize = 0;
        private bool m_PageListTagOpered = false;
        private int m_ListPagePubCount = 10;
        private int m_ListPagePubIndex = 1;
        private string m_ListPagePubWhereAdd = "";
        private int m_ListPageContentRealCount = 0;
        private string m_listPageRegName = "";
        private string m_SearchPageKeys = "";
        private string m_TemplateFileName = "";

        private Dictionary<string, string> m_TemplateVars = new Dictionary<string, string>();//模板变量 ，即当前位置：系统管理 -> 模板变量管理 里的变量
        private Hashtable m_dbHashtable = new Hashtable();
        private Hashtable m_dbROWHashtable = new Hashtable();



        #endregion

        #region 成员函数
        /// <summary>
        /// DataTable存放所有的数据列表【多行数据】
        /// </summary>
        public Dictionary<string, string> TemplateVars
        {
            get { return m_TemplateVars; }
            set { m_TemplateVars = value; }
        }

        /// <summary>
        /// DataTable存放所有的数据列表【多行数据】
        /// </summary>
        public Hashtable dbHashtable
        {
            get { return m_dbHashtable; }
            set { m_dbHashtable = value; }
        }
        /// <summary>
        /// DataRow 存放所有的数据行信息【单行数据】 
        /// </summary>
        public Hashtable dbROWHashtable
        {
            get { return m_dbROWHashtable; }
            set { m_dbROWHashtable = value; }
        }

        /// <summary>
        /// 模板文件
        /// </summary>
        public string TemplateFileName
        {
            get { return m_TemplateFileName; }
            set { m_TemplateFileName = value; }
        }

        /// <summary>
        /// 搜索页 关键字
        /// </summary>
        public string SearchPageKeys
        {
            get { return m_SearchPageKeys; }
            set { m_SearchPageKeys = value; }
        }

        /// <summary>
        /// 列表页动态访问页面名（正则）
        /// </summary>
        public string listPageRegName
        {
            get { return m_listPageRegName; }
            set { m_listPageRegName = value; }
        }

        /// <summary>
        /// 列表页 内容列表信息总数
        /// </summary>
        public int ListPageContentRealCount
        {
            get { return m_ListPageContentRealCount; }
            set { m_ListPageContentRealCount = value; }
        }

        /// <summary>
        /// 内容页是否分页
        /// </summary>
        public bool ContentCutFlag
        {
            get { return m_ContentCutFlag; }
            set { m_ContentCutFlag = value; }

        }

        /// <summary>
        /// 列表页,发布页 额外加的sql 
        /// </summary>
        public string ListPagePubWhereAddInner
        {
            get { return m_ListPagePubWhereAdd; }
            set { m_ListPagePubWhereAdd = value; }
        }

        /// <summary>
        /// 列表页,生成页数，一般情况下建议5页以内 
        /// </summary>
        public int ListPagePubCountOut
        {
            get { return m_ListPagePubCount; }
            set { m_ListPagePubCount = value; }
        }

        /// <summary>
        /// 列表页,生成页的起始位置  从1开始
        /// </summary>
        public int ListPagePubIndex
        {
            get { return m_ListPagePubIndex; }
            set { m_ListPagePubIndex = value; }
        }



        /// <summary>
        /// 已处理过分页标签了,内部使用 
        /// </summary>
        public bool PageListTagOperedOut
        {
            get { return m_PageListTagOpered; }
            set { m_PageListTagOpered = value; }
        }

        /// <summary>
        /// 解析的过程中遇到了分页标签并将其分页Num记录到此,内部使用 
        /// </summary>
        public int PageListSizeInner
        {
            get { return m_PageListSize; }
            set { m_PageListSize = value; }
        }

        /// <summary>
        /// 解析的过程中遇到了分页标签并将其标记记录到此,内部使用
        /// </summary>
        public string PageListTagInner
        {
            get { return m_PageListTag; }
            set { m_PageListTag = value; }
        }


        /// <summary>
        /// 解析的过程中是否遇到了分页标签,内部使用
        /// </summary>
        public bool FindPageListTagInner
        {
            get { return m_FindPageListTag; }
            set { m_FindPageListTag = value; }
        }

        /// <summary>
        /// 如果为内容页，此信息需要赋值，保存内容的DataTable
        /// </summary>
        public DataTable ContentTableOut
        {
            get { return m_dtContentTable; }
            set { m_dtContentTable = value; }
        }

        /// <summary>
        /// 当前模板文件所在的文件夹路径 需使用绝对路径
        /// </summary>
        public string CurrentFolderOut
        {
            get { return m_strCurrentFolder; }
            set { m_strCurrentFolder = value; }
        }

        /// <summary>
        /// 生成的页面的文件名，请去掉.html
        /// </summary>
        public string PageNameOut
        {
            get { return m_PageName; }
            set { m_PageName = value; }
        }
        /// <summary>
        /// 生成的页面的后缀名
        /// </summary>
        public string PageExtNameOut
        {
            get { return m_PageExtName; }
            set { m_PageExtName = value; }
        }

        /// <summary>
        /// 如果为内容页，此处需要设定，内容分页长度
        /// </summary>
        public int ContentPageLengthOut
        {
            get { return m_ContentPageLength; }
            set { m_ContentPageLength = value; }
        }
        /// <summary>
        /// 如果为内容页，此处需要设定，内容分页类型
        /// </summary>
        public string ContentPagingTypeOut
        {
            get { return m_ContentPagingType; }
            set { m_ContentPagingType = value; }
        }

        /// <summary>
        /// 如果为内容页，此信息需要赋值， 主内容字段
        /// </summary>
        public string ContentTableIndexFiledOut
        {
            get { return m_ContentTableIndexFiled; }
            set { m_ContentTableIndexFiled = value; }
        }

        /// <summary>
        /// 模板类型
        /// </summary>
        public EnumList.TemplateType TemplateTypeOut
        {
            get { return m_objTemplateType; }
            set { m_objTemplateType = value; }
        }

        /// <summary>
        /// 当前结点id
        /// </summary>
        public int NodeIdOut
        {
            get { return m_intNodeId; }
            set { m_intNodeId = value; }
        }

        /// <summary>
        /// 当前结点id
        /// </summary>
        public int ParentNodeIdOut
        {
            get { return m_intParentNodeId; }
            set { m_intParentNodeId = value; }
        }

        /// <summary>
        /// 当前信息id
        /// </summary>
        public int ContentIdOut
        {
            get { return m_intContentId; }
            set { m_intContentId = value; }
        }
        #endregion
    }
}
